package com.rainner.admin.server;

import java.sql.SQLException;
import java.util.List;

import com.rainner.admin.javabean.PermissionBean;
import com.rainner.admin.util.dbutil.BaseService;

public class PermissionServer extends BaseService<PermissionBean>{
	/**
	 * 返回权限的所有信息
	 * @return
	 * @throws SQLException
	 */
	public List<PermissionBean> allPermissionData(long rows,long page) throws SQLException{
		String sqlSelect = "select * from Permission limit ?,?";
		return super.query(sqlSelect,(page - 1) * rows, rows);
	}
	
	/**
	 * 返回权限的总共条数
	 * @return
	 * @throws SQLException
	 */
	public long countPermissionData() throws SQLException{
		String sqlSelect = "select COUNT(1) from Permission";
		return super.counts(sqlSelect);
	}
}
